import type { Category } from '@/type/CategoryType.ts'


import type { Phone, PhonePageReq } from '@/type/PhoneType.ts'
import type { ApiPageResp } from '@/type/ApiType.ts'
import { createDiscreteApi } from 'naive-ui'
import { OperatingSystemEnum } from '@/enum/PhoneEnum.ts'
import type { Brand } from '@/type/BrandType.js'

const { message } = createDiscreteApi(['message'])

export function useCategoryApi() {
  const treeCategory = async (param?:unknown): Promise<Category[]> => {
    console.log(param,"固定参数")
    return mock()
  }

  function mock():Category[] {
    const mockCategories: Category[] = [
      {
        id: 1,
        name: '手机',
        child: [
          {
            id: 11,
            name: '安卓手机',
            parentId: 1,
            child: null
          },
          {
            id: 12,
            name: 'iPhone',
            parentId: 1,
            child: null
          }
        ]
      },
      {
        id: 2,
        name: '平板',
        child: [
          {
            id: 21,
            name: '安卓平板',
            parentId: 2,
            child: null
          },
          {
            id: 22,
            name: 'iPad',
            parentId: 2,
            child: null
          }
        ]
      }
    ]
    return mockCategories
  }
  return {
    treeCategory,
  }
}


